package org.cqu_proj.demo.entity;

import org.bson.types.ObjectId;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

import java.util.List;

@Document(collection = "movies")
public class Movie {

    @Id
    private ObjectId id;
    // Movie ID
    private int movieId; // 电影的唯一标识符
    private String title; // 电影标题
    private String genres; // 电影的类型（多个类型用逗号分隔）
    private Double avgRating; // 平均评分
    private Long ratingCount; // 评分次数
    private int imdbId; // 对应 IMDb 的唯一标识符
    private int tmdbId; // 对应 TMDb 的唯一标识符

    public Movie() {
    }

    public Movie(ObjectId id, int movieId, String title, String genres, Double avgRating, Long ratingCount, int imdbId, int tmdbId) {
        this.id = id;
        this.movieId = movieId;
        this.title = title;
        this.genres = genres;
        this.avgRating = avgRating;
        this.ratingCount = ratingCount;
        this.imdbId = imdbId;
        this.tmdbId = tmdbId;
    }
    // Getters and Setters


    public int getMovieId() {
        return movieId;
    }

    public void setMovieId(int movieId) {
        this.movieId = movieId;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getGenres() {
        return genres;
    }

    public void setGenres(String genres) {
        this.genres = genres;
    }

    public Double getAvgRating() {
        return avgRating;
    }

    public void setAvgRating(Double avgRating) {
        this.avgRating = avgRating;
    }

    public Long getRatingCount() {
        return ratingCount;
    }

    public void setRatingCount(Long ratingCount) {
        this.ratingCount = ratingCount;
    }

    public int getImdbId() {
        return imdbId;
    }

    public void setImdbId(int imdbId) {
        this.imdbId = imdbId;
    }

    public int getTmdbId() {
        return tmdbId;
    }

    public void setTmdbId(int tmdbId) {
        this.tmdbId = tmdbId;
    }

    @Override
    public String toString() {
        return "Movie{" +
                "movieId=" + movieId +
                ", title='" + title + '\'' +
                ", genres='" + genres + '\'' +
                ", avgRating=" + avgRating +
                ", ratingCount=" + ratingCount +
                ", imdbId=" + imdbId +
                '}';
    }
}
